package com.itheima.easyexcellistener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.itheima.pojo.OrderSetting;

import java.util.ArrayList;
import java.util.List;

public class EasyExcelListener extends AnalysisEventListener<OrderSetting> {

    //定义这个list集合，在下面用来承载每次封装好的对象
    private List<OrderSetting>orderSettingList=new ArrayList<OrderSetting>();
    //给一个get方法，方便在其他类中获取到这个有数据的list集合
    public List<OrderSetting> getOrderSettingList() {
        return orderSettingList;
    }

    @Override//这个方法会逐次自动将xecel中指定的列封装成orderSetting对象
    public void invoke(OrderSetting orderSetting, AnalysisContext analysisContext) {
        orderSettingList.add(orderSetting);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
